package edu.gdkm.pay;

public class Teacher {
    private String teacherId;
    private String name;
    private String sex;
    private double salary;
    private double wage;

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        if (sex.equals("男") || sex.equals("女")) {
            this.sex = sex;
        }else {
            this.sex = "";
        }
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
       if (salary<0) {
           this.salary = 0;
       }else {
           this.salary = salary;
       }

    }

    public double getWage() {
        return wage;
    }

    public void setWage(double wage) {
        this.wage = wage;
    }

    public Teacher() {
    }

    public Teacher(String teacherId, String name, String sex, double salary, double wage) {
        this.teacherId = teacherId;
        this.name = name;
        this.sex = sex;
        this.salary = salary;
        this.wage = wage;
    }

    public Teacher(String teacherId, String name, String sex) {
        this.teacherId = teacherId;
        this.name = name;
        this.sex = sex;
    }

    public Teacher(String teacherId, String sex, double wage) {
        this.teacherId = teacherId;
        this.sex = sex;
        this.wage = wage;
    }

    public void print(){
        System.out.println("教工号："+teacherId+"，姓名："+name+"，性别："+sex);
    }
    public double total(){
        return salary+wage;
    }
}
